package com.dimong.www.loan.ui.adapter.holder;


import android.content.Context;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.dimong.loan.sdk.ui.adapter.BaseRecyclerViewHolder;
import com.dimong.www.loan.R;
import com.dimong.www.loan.bean.CardBean;
import com.dimong.loan.sdk.utils.GlideUtil;

public class CreditCardHolder extends BaseRecyclerViewHolder {
    private ImageView item_credit_card_pic;
    private TextView item_card_name;
    private TextView item_card_apply_num;
    private TextView item_card_summary;
    public CreditCardHolder(Context context,  ViewGroup parent) {
        super(context, R.layout.item_credit_card, parent);

        item_credit_card_pic = findViewById(R.id.item_credit_card_pic);
        item_card_name = findViewById(R.id.item_card_name);
        item_card_apply_num = findViewById(R.id.item_card_apply_num);
        item_card_summary = findViewById(R.id.item_card_summary);
    }
    @Override
    public void setData(Object object) {
        super.setData(object);
        if(object instanceof CardBean){
            CardBean cardBean = (CardBean) object;
            GlideUtil.loadImg(mContext,cardBean.getCard_logo(),item_credit_card_pic);
            item_card_name.setText(cardBean.getCard_name());
            item_card_apply_num.setText(cardBean.getApply_num());
            item_card_summary.setText(cardBean.getSummary());
        }
    }
}
